/***************************************************************************                            *
 *Author: Achilles Zhang												   *
 *Date: 2012.03.28														   *
 *File Name: Statistics.cpp										   *
 *Description: The file is used to declare the function of caculating area.	       *
 ***************************************************************************/
#ifndef STATISTICS_H
#define STATISTICS_H

#include "GlobalHead.h"
#include "View3DInventor.h"
#include "MainWindow.h"
#include "StatisticsDialog.h"
#include "CustomPlayer.h"

#include "CKALL.h"

class Statistics{
public:
	Statistics();
	~Statistics();

public:
	void do_superficial_area(CK3dEntity *ent);
	void showDialog();
	void caciulate(CK3dEntity *ent);
	static Statistics* Instance();
	static void destruct();
	static Statistics* _singleton;
	CKBOOL bLeft;
	CK3dEntity *m_entity;

	static bool eventCallback(CKRenderContext *context,CKRenderObject* ent,void *Argument);
	void addPostRenderCallBack(/*CKRenderObject **/);
	void removePostRenderCallBack(/*CKRenderObject **/);
	void caculatetArea();
	void new_caculateArea();
	float getArea(VxVector, VxVector, VxVector);
	bool isInArea(VxVector);
	bool isInTriangle(VxVector, VxVector, VxVector, VxVector);

	int spotNum;

	vector<VxVector> pointVector;
	vector<VxPlane> planeVector;
	vector<VxVector> pointInArea;
private:
	StaticsDialog *staticsDialog;
	
};

#endif //STATISTICS_H